<template>
  <div class="cus">
    <div class="cus_box" style="width:1000px;" v-loading="loading">
      <div class="title">
        <span>EmployRecord</span>
        <i @click="$emit('Affiliated_agents_call')" class="el-icon-close"></i>
      </div>
      <div class="content">
        <el-form
          :inline="true"
          :model="dataForm"
          :rules="dataRule"
          ref="dataForm"
          label-width="auto"
        >
          <el-form-item label="" prop="adName">
            <el-input
              v-model="dataForm.adName"
              type="text"
              placeholder="商家Name"
              style="width:150px;"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="" prop="adName">
            <el-input
              v-model="dataForm.adName"
              type="text"
              placeholder="Phone"
              style="width:150px;"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="" prop="adName">
            <el-input
              v-model="dataForm.adName"
              type="text"
              placeholder="上级Agent"
              style="width:150px;"
              clearable
            ></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary">Search</el-button>
          </el-form-item>
        </el-form>

        <el-table
          :data="tableData"
          height="450"
          highlight-current-row
          border
          style="width: 100%"
        >
          <el-table-column prop="date" label="序号" width="180">
          </el-table-column>
          <el-table-column prop="name" label="Agent Name" width="180">
          </el-table-column>
          <el-table-column prop="address" label="Agent地址"> </el-table-column>
          <el-table-column prop="address" label="联系人"> </el-table-column>
          <el-table-column prop="address" label="Phone"> </el-table-column>
          <el-table-column prop="address" label="设备信息"> </el-table-column>
          <el-table-column prop="address" label="站点数量"> </el-table-column>
          <el-table-column prop="address" label="Status"> </el-table-column>
          <el-table-column prop="address" label="Operations">
            <template slot-scope="scope">
              <el-button type="text">Cancel关联</el-button>
            </template>
          </el-table-column>
        </el-table>

        <div class="btns">
          <el-button @click="$emit('Affiliated_agents_call')">Cancel</el-button>
          <el-button type="primary" @click="dataFormSubmit()">关联</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { isMobile } from "@/utils/validate";
export default {
  data() {
    var validateMobile = (rule, value, callback) => {
      if (!isMobile(value)) {
        callback(new Error("Phone格式错误"));
      } else {
        callback();
      }
    };
    return {
      loading: false,
      fileList: [],
      src: "",
      dataForm: {
        adName: "",
        type: "",
        times: "",
        url: "",
        equipmentNos: ""
      },
      equipmentNos_list: [],
      longitude: "",
      latitude: "",
      dataRule: {
        adName: [{ required: true, message: "Please Input", trigger: "blur" }],
        type: [{ required: true, message: "Please Upload", trigger: "blur" }],
        equipmentNos: [
          { required: true, message: "Please Select", trigger: "blur" }
        ]
      },

      tableData: [
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-08",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-06",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        }
      ]
    };
  },
  computed: {},
  components: {},
  props: ["res"],

  methods: {
    // Form Submit
    dataFormSubmit() {
      this.$refs["dataForm"].validate(valid => {
        if (valid) {
        }
      });
    }
  }
};
</script>
<style scoped lang="scss"></style>
